
package com.probiz.estore.customer.service.dwr;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.probiz.estore.common.model.customer.Membership;
import com.probiz.estore.customer.model.MembershipVO;
import com.probiz.estore.customer.service.MembershipManager;

public class MembershipDwrImpl {
	protected final transient Log	log				= LogFactory
															.getLog(getClass());
	private MembershipManager		mgr				= null;

	public List getMemberships() {
		List rs = new ArrayList();
		for (Membership membership : mgr.getAllMembershipsOrderByLevel(true)) {
			MembershipVO vo = new MembershipVO();
			vo.setMembershipId(membership.getMembershipId());
			vo.setMembershipName(membership.getMembershipName());
			rs.add(vo);
		}
		return rs;
	}

	public void setMembershipManager(MembershipManager manager) {
		mgr = manager;
	}

}
